-
Notifications
You must be signed in to change notification settings - Fork 595
【Inference Optimize】optimize DeepSeek_v3 #3349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for your contribution! |
q, | ||
k, | ||
v, | ||
forward_meta.cu_seqlens_q, | ||
forward_meta.cu_seqlens_k, | ||
metadata.max_enc_len_this_time, | ||
metadata.max_enc_len_this_time, | ||
self.attn_softmax_scale, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.attn_softmax_scale 这个参数,这样传入的话,会用你上面创建的{"scale": self.head_dim**-0.5, 吗?
self.attn_softmax_scale 看之前的代码,是经过self.attn_softmax_scale * mscale * mscale计算出来的
self.attn_softmax_scale, | ||
causal=True, | ||
training=False, | ||
max_seqlen_q=forward_meta.max_len_tensor_cpu[0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改之后,测过之前的flash_attn_unpadded没, 输出是否有变化
|
||
if forward_meta.max_len_tensor_cpu[2]: # max_dec_len_this_time | ||
# NOTE: (changwenbin) We will take the public part |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take 如何理解, 是准备表达will solove public part,还是会计算public part
1、Eliminate redundant calculations
2、Enable FA3 on the H card to execute the encoder
you need
export FLAGS_flash_attn_version=3